{{Strip}}
{{Extend "base"}}
{{Block "description"}}{{"管理面板登录"|$.T}}{{/Block}}
{{Block "title"}}{{"管理面板登录"|$.T}}{{/Block}}
{{Block "themeColor"}}#26262E{{/Block}}
{{Block "bodyAttr"}} class="texture"{{/Block}}
{{Block "main"}}
<div id="cl-wrapper" class="login-container">

	<div class="middle-login">
		<div class="block-flat">
			<div class="header">							
				<h3 class="text-center"><img class="logo-img logo-img-sm" src="{{AssetsURL}}/images/logo.png" alt="logo"/>{{"账号登录"|$.T}}</h3>
			</div> 
			<div>
				<form style="margin-bottom: 0px !important;" class="form-horizontal" data-secret="{{SM2PublicKey}}:{{call $.Func.EnvKey}}" id="login-form" action="{{BackendURL}}/login" method="POST">
					<div class="content">
						<div class="form-group">
							<div class="col-sm-12">
								<div class="input-group" data-toggle="tooltip" title="{{`用户名`|$.T}}">
									<span class="input-group-addon"><i class="fa fa-user"></i></span>
									<input type="text" placeholder="{{`用户名`|$.T}}" value="{{$.Form `user`}}" name="user" required="required" class="form-control" autofocus="autofocus">
								</div>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12">
								<div class="input-group" data-toggle="tooltip" title="{{`密码`|$.T}}">
									<span class="input-group-addon"><i class="fa fa-lock"></i></span>
									<input type="password" id="password" placeholder="{{`密码`|$.T}}" value="{{$.Form `pass`}}" name="pass" required="required" class="form-control">
								</div>
							</div>
						</div>
							
						<div class="form-group">
							<div class="col-sm-12">
								{{call $.Func.CaptchaForm `default`}}
							</div>
						</div>
					</div>
					<div class="foot">
						<input type="hidden" name="next" value="{{$.Form `next`}}">
						{{- range $k,$footer := call $.Func.DashboardConfig `login.GroupedButtons#bottom` -}}
						{{- if $footer -}}
						{{- if $footer.Tmpl}}{{$.Fetch $footer.Tmpl $}}{{end -}}
						{{- end -}}
						{{- end -}}
						<a class="btn btn-default" href="{{BackendURL}}/register">{{"注册"|$.T}}</a>
						<button class="btn btn-primary" data-dismiss="modal" type="submit">{{"登录"|$.T}}</button>
						{{- $oAuthAccounts := call $.Func.oAuthAccounts -}}
						{{- if $oAuthAccounts -}}
						<fieldset class="fieldset no-margin-y">
							<legend><span class="small">{{"用外部账号登录"|$.T}}</span></legend>
							<ul class="list-inline clearfix xs-padding-left">
						{{- range $k,$v:=$oAuthAccounts -}}
							<li class="pull-left no-padding-left">
							<a rel="nofollow" class="btn btn-warning no-margin" href="{{BackendURL}}/oauth/login/{{$v.Name}}">
							{{- $title := $v.Extra.String `title` -}}
							{{- if $title -}}
							{{- $title -}}
							{{- else -}}
							{{- Title $v.Name -}}
							{{- end -}}
							</a>
							</li>
						{{- end -}}
							</ul>
						</fieldset>
						{{- end -}}
					</div>
				</form>
			</div>
		</div>
		<div class="text-center out-links">
			<a href="{{OfficialHomepage}}" target="_blank">&copy; {{Now.Year}} {{Version}}</a>
		</div>
	</div> 

</div>
{{/Block}}
{{Block "footer"}}
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/crypto-js.min.js?t={{BuildTime}}"></script>
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/sm2.min.js?t={{BuildTime}}"></script>
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/helper.min.js?t={{BuildTime}}"></script>
{{- range $k,$footer := call $.Func.DashboardConfig `login.GlobalFooters` -}}
{{- if $footer -}}
{{- if $footer.Tmpl}}{{$.Fetch $footer.Tmpl $}}{{end -}}
{{- end -}}
{{- end -}}
<script type="text/javascript">
$(function(){
$('[data-toggle="tooltip"]').tooltip();
submitEncryptedData('#login-form');
});
</script>
{{/Block}}
{{/Strip}}
